﻿package mortal.game.view.copy.QuestionCopy.data
{
    import mortal.common.*;
    import mortal.game.cache.*;
    import mortal.game.mvc.*;
    import mortal.game.resource.*;
    import mortal.game.scene3D.player.info.*;

    public class LevelCheckUtil extends Object
    {
        public static var lineOn:int = 40;
        public static var lineOffCopy:int = 44;
        public static var lineOffExp:int = 45;
        public static var question:int = 54;
        public static var sunbath:int = 55;
        public static var pet:int = 2;
        public static var trade:int = 76;
        public static var guildBoss:int = 89;
        public static var mercenary:int = 93;

        public function LevelCheckUtil()
        {
            return;
        }// end function

        public static function addInit(param1:Function) : void
        {
            EventUtil.addSelfEvent(EventName.NavbarButtonUIRowInited, param1, true);
            return;
        }// end function

        public static function addLevelUp(param1:Function) : void
        {
            Cache.instance.role.roleEntityInfo.addEventListener(EntityInfoEventName.UpdateLevel, param1);
            return;
        }// end function

        public static function addInitAndLevelUp(param1:Function) : void
        {
            addInit(param1);
            addLevelUp(param1);
            return;
        }// end function

        public static function isLevelEnougth(param1:int) : Boolean
        {
            var _loc_2:* = Cache.instance.role.entityInfo.level;
            var _loc_3:* = getLevel(param1);
            if (_loc_2 >= _loc_3)
            {
                return true;
            }
            return false;
        }// end function

        public static function getLevel(param1:int) : int
        {
            var _loc_2:* = GameDefConfig.instance.getSystemOpenLevel(param1);
            return _loc_2;
        }// end function

        public static function isSystemOpen(param1:int) : Boolean
        {
            switch(param1)
            {
                case pet:
                {
                    if (Cache.instance.newPet.pet && Cache.instance.newPet.pet.state != -1)
                    {
                        return true;
                    }
                    break;
                }
                default:
                {
                    break;
                }
            }
            return false;
        }// end function

        public static function get curLevel() : int
        {
            var _loc_1:* = Cache.instance.role.entityInfo.level;
            return _loc_1;
        }// end function

    }
}
